package com.org.gsc.chartdemo.activitys;

import com.github.mikephil.charting.charts.BarLineChartBase;
import com.github.mikephil.charting.components.AxisBase;
import com.github.mikephil.charting.formatter.IAxisValueFormatter;
/**
 * Created by qundui on 2017/8/29.
 * X  轴的自定义构造器
 * 显示一次月考 第二次月考 第三次月考 第四次月考.......
 *
 */
public class XAxisValueFormatter  implements IAxisValueFormatter {

    protected String[] mMonths = new String[]{
            "Jan", "Feb", "Mar", "Apr", "May",
    };
    private BarLineChartBase<?> chart;

    public XAxisValueFormatter(BarLineChartBase<?> chart) {
        this.chart = chart;
    }
    @Override
    public String getFormattedValue(float value, AxisBase axis) {
        return mMonths[(int) value];
    }
}
